package com.red.wine.view;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.view.View;

public class CenterView extends View{
	private int height;
	private int width;
	private Context context;
	private Bitmap bitmap;
	public CenterView(Context context, AttributeSet attrs) {
		super(context, attrs);
	}
	
	public CenterView(Context context, Bitmap bitmap, int width, int height){
		super(context);
		this.context = context;
		this.bitmap = bitmap;
		this.width = width;
		this.height = height;
	}

	@Override
	protected void onDraw(Canvas canvas) {
		super.onDraw(canvas);
		canvas.drawBitmap(bitmap, width/2-bitmap.getWidth()/2, height/2 - bitmap.getHeight()/2, null);
	}
}
